//初始加载
$(function(){
	$("#submitButton").click(function(){
		var username = $("#username").val();
		var password = $("#password").val();
		var data = $("#formData").serialize();
		if(username==""||password==""){
			$("#errorInfo").html("帐号或密码不能为空！");
		}else{
			$.ajax({
				type:'post',
				url:loginUrl,
				data:data,
				success:function(data,textStatus, XMLHttpRequest){
					if(data.success==true){
						window.location.href=data.message;
					}else{
						$("#errorInfo").html(data.errorMessage);
					}
				}
			});
		}
		
	});
});